﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RestSharp;
using Moq;
using System.Collections.Generic;
using MsForgeReboot.Framework.TownCrierChannels;

namespace MsForgeReboot.Framework.Tests.Channels {
    [TestClass]
    public class TwitterChannelTests {

        private IRestRequest _request;
        private IRestClient _client;
        private IRestResponse _response;
        private List<Parameter> _params;

        //private TwitterChannelSection _configuration;

        [TestInitialize]
        public void TestInitialize() {

            // Mock the response
            var res = new Mock<IRestResponse>();
            res.SetupGet(q => q.Content).Returns(() => "Test content");

            this._response = res.Object;

            // Mocking the client
            var client = new Mock<IRestClient>();
            client.Setup(c => c.Execute(It.IsAny<IRestRequest>())).Returns((IRestRequest r) => this._response);

            this._client = client.Object;


            // MOcking the request
            var req = new Mock<IRestRequest>();
            req.Setup(r => r.AddParameter(It.IsAny<Parameter>())).Callback((Parameter p) => this._params.Add(p));

            this._request = req.Object;

            // Confirugation stuff
            //this._configuration = new TwitterChannelSection();
        }

        [TestMethod]
        public void TwitterChannelShouldCreateAPostRequestOnCallToMethod() {
        }

        [TestMethod]
        public void TwitterChannelPostMethodShouldFormatRequestDataAsJson() { }

        [TestMethod]
        public void TwitterChannelShouldReturnDeliveryResultOnRequest() { }

        [TestMethod]
        public void TwitterChannelShouldReturnCorrectValuesForSuccesfulRequest() { }

        [TestMethod]
        public void TwitterChannelShouldReturnCorrectValuesForUnsuccesfulRequest() { }

    }
}
